﻿Imports System.ComponentModel.DataAnnotations
Imports SistemaINCA.Models.Validators

Namespace Models.ViewModels
    Public Class MatriculaModel

        <Display(Name:="Grado en el que desea estudiar")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Contiene(New String() {"1", "2", "3"})> _
        Property frm_grado As Integer

        <Display(Name:="Especialidad que desea estudiar")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Contiene(New String() {"General", "Ciencias Economicas"})> _
        Property frm_especialidad As String

        <Display(Name:="Nombres del alumno")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_Nombres As String

        <Display(Name:="Apellidos del alumno")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_Apellidos As String

        <Display(Name:="Genero")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Contiene(New String() {"M", "F"})> _
        Property frm_Genero As Char

        <Display(Name:="DUI")> _
        <RegularExpression("^[0-9]{8}\-\d$", ErrorMessageResourceName:="Error_DUI", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_DUI As String

        <Display(Name:="NIE")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_NIE As String

        <Display(Name:="Genero")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Remote("Validate_Pais", "Validations", ErrorMessage:="El país ingresado no existe en la base de datos")> _
        Property frm_Pais As String

        <Display(Name:="Fecha de Nacimiento")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <RegularExpression("^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d$", ErrorMessageResourceName:="Error_Fechas_DataType", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <IsDate(ErrorMessageResourceName:="Error_Convert_Date", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_FNacimiento As String

        <Display(Name:="¿Estudio Parvularia?")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Contiene(New String() {"0", "1"})> _
        Property frm_eparvularia As Integer

        <Display(Name:="Centro Escolar de Procedencia")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Remote("Validate_CentroEscolar", "Validations", ErrorMessage:="El Centro Escolar de procedencia ingresado no existe en la base de datos.")> _
        Property frm_CEProcedencia As String

        <Display(Name:="Dirección")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_Direccion As String

        <Display(Name:="Departamento")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Contiene(New String() {"Ahuachapán", "Cabañas", "Chalatenango", "Cuscatlán", "La Libertad", "La Paz", "La Unión", "Morazán", _
                                "San Miguel", "San Salvador", "San Vicente", "Santa Ana", "Sonsonate", "Usulután"})> _
        Property frm_Departamento As String

        <Display(Name:="Departamento")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Range(1, 14)> _
        Property frm_DepartamentoID As Integer

        <Display(Name:="Municipio")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Remote("Validate_Municipio", "Validations", AdditionalFields:="frm_DepartamentoID", ErrorMessage:="El municipio ingresado no existe en la base de datos o el municipio no pertenece al departamento seleccionado.")> _
        Property frm_Municipio As String

        <Display(Name:="Telefono de contacto")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <RegularExpression("^(2|7)\d{3}\-\d{4}$", ErrorMessageResourceName:="Error_Telefono", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_Telefono As String

        <Display(Name:="Celular")> _
        <RegularExpression("^(2|7)\d{3}\-\d{4}$", ErrorMessageResourceName:="Error_Telefono", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_Celular As String

        <Display(Name:="Correo Electrónico")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <DataType(DataType.EmailAddress, ErrorMessageResourceName:="Error_EMail", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        Property frm_CorreoE As String

        <Display(Name:="Miembros que viven con el alumno")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Range(1, 25)> _
        Property frm_NMiembros As Integer

        <Display(Name:="¿Trabaja?")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Contiene(New String() {"0", "1"})> _
        Property frm_trabaja As Integer

        <Display(Name:="¿Tiene hijos?")> _
        <Required(ErrorMessageResourceName:="Error_Field_Required", ErrorMessageResourceType:=GetType(My.Resources.ErrorMessageResources))> _
        <Contiene(New String() {"0", "1"})> _
        Property frm_thijos As Integer

        <Display(Name:="Enfermedades que padece")> _
        Property frm_EnfermedadesPadece As String

        <Display(Name:="Medicamento permanente")> _
        Property frm_MedicamentoPermanente As String
    End Class
End Namespace
